USE [StockPredictor]
GO

/****** Object:  Table [dbo].[UserPreferences]    Script Date: 10/23/2012 7:24:04 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[UserPreferences](
	[PreferenceId] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NOT NULL,
	[PeRatioPrcntg] [int] NULL,
	[EpsPrcntg] [int] NULL,
	[SpreadPrcntg] [int] NULL,
	[NotificationFrequency] [nvarchar](5) NULL,  /*** 'M' for Monthly, 'W' for weekly  ***/
	[NotificationSendStocksToSell] [char](5) NULL, /*** 'Y' or 'N' ***/
	[NotificationSendStocksToBuy] [char](5) NULL,   /*** 'Y' or 'N' ***/
	[NotificationLastSentTime] [datetime] NULL
 CONSTRAINT [PK_Preferences] PRIMARY KEY CLUSTERED 
(
	[PreferenceId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[UserPreferences]  WITH CHECK ADD  CONSTRAINT [FK_UserPreferences_UserProfile] FOREIGN KEY([UserId])
REFERENCES [dbo].[UserProfile] ([UserId])
GO

ALTER TABLE [dbo].[UserPreferences] CHECK CONSTRAINT [FK_UserPreferences_UserProfile]
GO




